<template>
  <div class="detailPageCss">
    <div class="titleCss">企业体检结果告知书</div>
    <div class="bodyCss">
      <div class="tableCss">
        <el-table
          max-height="640"
          :data="tableData"
          border
          style="width: 100%">
          <el-table-column
            prop="enterpriseName"
            label="用工单位名称"
            min-width="200">
          </el-table-column>
          <el-table-column
            prop="personnelName"
            label="姓名"
            min-width="100">
          </el-table-column>
          <el-table-column
            prop="identityNumber"
            label="证件号码"
            min-width="180">
          </el-table-column>
          <el-table-column
            prop="workStatus"
            label="在岗状态"
            min-width="120">
            <template #default="scope">
              {{ data4Map[scope.row.workStatus] }}
            </template>
          </el-table-column>
          <el-table-column
            prop="blnRecheck"
            label="是否复检"
            min-width="80">
            <template #default="scope">
              {{ data5Map[scope.row.blnRecheck] }}
            </template>
          </el-table-column>
          <el-table-column
            prop="examTime"
            label="体检日期"
            min-width="100">
          </el-table-column>
          <el-table-column
            prop="reportIssueTime"
            label="报告出具日期"
            min-width="100">
          </el-table-column>
          <el-table-column
            prop="blnAbnormal"
            label="是否异常"
            min-width="80">
            <template #default="scope">
              {{ data7Map[scope.row.blnAbnormal] }}
            </template>
          </el-table-column>
          <el-table-column
            prop="abnormalInfo"
            label="异常信息"
            min-width="200">
          </el-table-column>
          <el-table-column
            prop="blnUpload"
            label="告知书是否上传"
            min-width="80">
            <template #default="scope">
              {{ data9Map[scope.row.blnUpload] }}
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center" fixed="right" width="100">
            <template slot-scope="scope">
              <el-button size="mini" type="text" @click="lookBookDetailBtn(scope.row)">查看告知书</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          style="margin-top:10px;text-align: right;"
          background
          :pageSize="pageSize"
          layout="prev, pager, next"
          :page-sizes="[10, 20, 50]"
          :total="total"
          @sizeChange="handleSizeChange"
          @currentChange="handleCurrentChange">
        </el-pagination>
      </div>
    </div>
    <div class="bottomBtnCss">
      <el-button @click="goBackBtn">返回</el-button>
    </div>
  </div>
</template>

<script>
import { getCurrentDay } from '@/utils/business.js'
import { getEnterpriseExamResultNotice, exportExamResultNotice } from "@/api/zhangping/companyHealthResultDetail";
export default {
  data(){
    return{
      tableData:[],
      pageSize:10,
      total:1000,
      data4Map:{
        0:'上岗前',
        1:'在岗期间',
        2:'离岗前',
      },
      data5Map:{
        0:'是',
        1:'否',
      },
      data7Map:{
        0:'是',
        1:'否',
      },
      data9Map:{
        0:'是',
        1:'否',
      },
    }
  },
  mounted(){
    this.getList()
  },
  methods:{
    lookBookDetailBtn(row){
      exportExamResultNotice({staffId:this.$route.query.info.id}).then(res=>{
        console.log(res);//接口报错不知道返参
        // window.open('http://36.137.225.215:7799/prod-api'+)
      })
      // this.$router.push(obj);
    },
    async getList(){
       getEnterpriseExamResultNotice({staffId:5}).then(response=>{//测试数据
        console.log(response);
        if (response.code=='200') {
          this.tableData = response.rows
          this.total = response.total
        }
        
       })
      
    },
    handleCurrentChange(){
      
    },
    handleSizeChange(){
      
    },
    resetBtn(){

    },
    searchBtn(){
      
    },
    goBackBtn(){
      this.$router.back()
    },
  },
}
</script>

<style lang="scss" scoped>
.detailPageCss{
  overflow: hidden;
  position: relative;
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  height: calc( 100vh - 66px - 40px);
  display: flex;
  flex-direction: column;
  .titleCss{
    text-align: center;
    font-size: 18px;
    font-weight: bold;
  }
  .bodyCss{
    margin-top: 20px;
    width: calc( 100% - 20px);
    margin-left: 10px;
    height: calc( 100% - 90px);
    overflow-y: auto;
    .el-form{
      display: flex;
      flex-wrap: wrap;
      border-bottom: 1px solid #f2f2f2;
      .formBtnCss{
        margin-left: 20px;
        text-align: center;
      }
    }
  }
  .bottomBtnCss{
    margin-top: auto;
    text-align: right;
  }
}
::v-deep .el-form-item__content{
  width: 200px;
}
</style>